package com.sakirhatipoglu.hastane.data;

import java.util.ArrayList;

import com.sakirhatipoglu.hastane.R;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class BolumAdapter extends ArrayAdapter<Bolum>{
	
	Context context; 
    int layoutResourceId;    
    ArrayList<Bolum> list = null;
    
    public BolumAdapter(Context context, int layoutResourceId,   ArrayList<Bolum> list) {
        super(context, layoutResourceId, list);
        this.layoutResourceId = layoutResourceId;
        this.context = context;
        this.list = list;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View row = convertView;
        LayoutInflater inflater = ((Activity)context).getLayoutInflater();
        row = inflater.inflate(layoutResourceId, parent, false);
        
        TextView textView= (TextView)row.findViewById(R.id.ad);
        textView.setText(list.get(position).getBolumAdi());
        row.setTag(list.get(position));
    
        
        return row;
    }
    
}


